import Vuex from 'vuex'
import Vue from 'vue'
import song from '@/store/song_module/song'
import search from "@/store/search_module/search";
import user from '@/store/user_module/user'
import {method,confirm,dialog} from "@/config/mode-config/config";

Vue.use(Vuex)

export default new Vuex.Store({
    state: {
        confirm: confirm.no,
        dialog: dialog.hide,
        selectFlag: method.addAll  // false
    },
    getters: {
        confirm: state => state.confirm,
        dialogFlag: state => state.dialog,
        selectFlag: state => state.selectFlag
    },
    mutations: {
        setConfirm: (state, flag) => state.confirm = flag,
        setDialogFlag: (state,flag) => state.dialog = flag,
        setFlag: (state,mode) => state.selectFlag = mode
    },
    modules: {
        song,
        search,
        user
    }
})
